package cn.bob.org.eum;

import com.sun.org.apache.regexp.internal.RE;
import lombok.AllArgsConstructor;
import lombok.Getter;


import java.util.Arrays;

/**
 * @author bob
 * @data 2022/10/17-16:33
 */
@Getter
@AllArgsConstructor
public enum  ShopStateEum {
    WAIT_AUDIT(0,"待审核"),
    HAVE_AUDIT(1,"待审核"),
    REJECT(-1,"待审核"),
    PASS(2,"待审核");

    private int code;
    private String  name;

    public  static  String getNameByCode(Integer code){
        ShopStateEum stateEum = Arrays.stream(ShopStateEum.values()).filter(state -> state.getCode() == code).findAny()
                .orElse(null);
        return  null ==stateEum?"":stateEum.getName();
    }

}
